/*
 * @author: sanbao
 * @Date: 2022-07-31 14:50:02
 */
import {
  createRouter,
  createWebHashHistory
} from 'vue-router'
import Layout from '../layout/index.vue'

const routes = [{
  path: '/',
  name: '_layout',
  component: Layout,
  redirect: '/index',
  children: [{
      path: '/index',
      name: '_about',
      component: () => import('@/components/page/index')
    },
    {
      path: '/goods',
      name: '_goods',
      component: () => import('@/components/page/goods'),
    }, {
      path: '/users',
      name: '_users',
      component: () => import('@/components/page/users')
    },
    {
      path: '/details',
      name: '_details',
      component: () => import('@/components/page/details')
    },
    {
      path: '/order',
      name: '_order',
      component: () => import('@/components/page/order')
    },
    {
      path: '/shoppingCart',
      name: '_shoppingCart',
      component: () => import('@/components/page/shoppingCart')
    },
    {
      path: '/collect',
      name: '_collect',
      component: () => import('@/components/page/collect')
    },
    {
      path: '/confirmOrder',
      name: '_confirmOrder',
      component: () => import('@/components/page/confirmOrder')
    }
  ]
}]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router